<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%@include file="/commons/taglibs.jsp" %>
<!DOCTYPE html>
<html>
<fmt:bundle basename="res">
<head>
    <meta charset="utf-8">
    <title><fmt:message key='ttblsjxt'/></title>
    <jsp:include page="/WEB-INF/commons/commons-header.jsp" flush="true"/>
    <style>
        html {
            background: #fff;
        }
    </style>
</head>

<body>
<div class="layui-container">
    <div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" style="padding: 20px 30px 0 0;">

        <form:form commandName="goods" class="layui-form" id="form">

            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                <legend><fmt:message key='jbxx'/></legend>
            </fieldset>

            <div class="layui-form-item goodsChannelArea">
                <label class="layui-form-label"><fmt:message key='splm'/></label>

                <div class="layui-form-mid layui-word-aux">
                        ${goods.goodsChannel.parent.parent.name} >> ${goods.goodsChannel.parent.name} >> ${goods.goodsChannel.name}
                </div>

            </div>

            <div class="layui-form-item">
                <label class="layui-form-label"><fmt:message key='spmc'/></label>
                <div class="layui-form-mid layui-word-aux">
                        ${goods.name}
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label"><fmt:message key='spbh'/></label>
                <div class="layui-form-mid layui-word-aux">
                        ${goods.goodsNo}
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label"><fmt:message key='spjg'/></label>
                <div class="layui-form-mid layui-word-aux">
                    <fmt:formatNumber value="${goods.defaultPrice}" type="CURRENCY"/>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label"><fmt:message key='scj'/></label>
                <div class="layui-form-mid layui-word-aux">
                    <fmt:formatNumber value="${goods.marketPrice}" type="CURRENCY"/>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label"><fmt:message key='yfjsfs'/></label>
                <div class="layui-form-mid layui-word-aux">
                    <c:choose>
                        <c:when test="${goods.postageType eq 1}"><fmt:message key='yfmb'/>-${goods.freightTemplate.name}</c:when>
                        <c:when test="${goods.postageType eq 2}"><fmt:message key='by'/></c:when>
                        <c:when test="${goods.postageType eq 3}"><fmt:message key='zdyf'/></c:when>
                    </c:choose>
                </div>
            </div>

            <c:if test="${goods.postageType eq 3}">
                <div class="layui-form-item">
                    <label class="layui-form-label"><fmt:message key='zdyf'/></label>
                    <div class="layui-form-mid layui-word-aux">
                            ${goods.postage}
                    </div>
                </div>
            </c:if>


            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                <legend><fmt:message key='spgg'/></legend>
            </fieldset>


            <div class="layui-form-item">
                <label class="layui-form-label"><fmt:message key='spsku'/></label>
                <div class="layui-input-block">
                    <table class="layui-table" lay-size="sm" id="feijin-sku-table">
                        <thead>
                        <th><fmt:message key='gg'/></th>
                        <th><fmt:message key='sjbh'/></th>
                        <th><fmt:message key='kcs'/></th>
                        <th><fmt:message key='xsj'/></th>
                        </thead>
                        <tbody>
                        <c:forEach items="${goods.skus}" var="sku">
                            <tr>
                                <td>${sku.skuNames}</td>
                                <td>${sku.code}</td>
                                <td>${sku.store}</td>
                                <td><fmt:formatNumber value="${sku.price}" type="CURRENCY"/></td>
                            </tr>
                        </c:forEach>
                        </tbody>
                    </table>
                </div>
            </div>

            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                <legend><fmt:message key='spxc'/></legend>
            </fieldset>

            <div class="layui-form-item">
                <label class="layui-form-label"><fmt:message key='spfm'/></label>
                <div class="layui-inline">
                    <div id="feijinImage-defaultImage">
                        <c:if test="${not empty goods.defaultImage}">
                            <img class="preview" src="${store_domain}/uploads/${goods.defaultImage}" style="width:120px;height:120px;margin-top:10px;">
                        </c:if>
                        <c:if test="${empty goods.defaultImage}">
                            <img src="${web_domain}/resources/images/default.jpeg" style="width:120px;height:120px;margin-top:10px;">
                        </c:if>
                    </div>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label"><fmt:message key='spxc'/></label>
                <div class="layui-input-block">

                    <div id="feijinImageArea">
                        <c:choose>
                            <c:when test="${empty goods.images}">
                                <img id="goodsImages-defaultImage" src="${web_domain}/resources/images/default.jpeg" style="width:120px;height:120px;margin-top:10px;">
                            </c:when>
                            <c:otherwise>
                                <c:forEach items="${goods.images}" var="goodsImage">
                                    <li id='li${goodsImage.id}' style='display: inline-block; text-align: center; margin: 10px 15px;'><img style='width:100px;height:100px; display: block; margin-bottom: 5px;' class='feijin-images preview' data-src='${goodsImage.name}' src='${store_domain}/uploads/${goodsImage.name}'/></li>
                                </c:forEach>
                            </c:otherwise>
                        </c:choose>
                    </div>

                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label"><fmt:message key='spzzcl'/></label>
                <div class="layui-inline">
                    <div id="feijinImage-qualificationImage">
                        <c:if test="${not empty goods.qualificationImage}">
                            <img class="preview" src="${store_domain}/uploads/${goods.qualificationImage}" style="width:120px;height:120px;margin-top:10px;">
                        </c:if>
                        <c:if test="${empty goods.qualificationImage}">
                            <img src="${web_domain}/resources/images/default.jpeg" style="width:120px;height:120px;margin-top:10px;">
                        </c:if>
                    </div>
                </div>
            </div>

            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                <legend><fmt:message key='spnr'/></legend>
            </fieldset>

            <div class="layui-form-item">
                <label class="layui-form-label"><fmt:message key='spcs'/></label>
                <div class="layui-input-block">
                    <table class="layui-table" lay-size="sm">
                        <thead>
                        <th><fmt:message key='csmc'/></th>
                        <th><fmt:message key='csz'/></th>
                        </thead>
                        <tbody>
                        <c:forEach items="${goods.paramses}" var="item" varStatus="index">
                            <tr>
                                <td>${item.paramsName}</td>
                                <td>${item.paramsValue}</td>
                            </tr>
                        </c:forEach>
                        </tbody>
                    </table>


                </div>
            </div>

            <div class="layui-form-item">
                <label for="" class="layui-form-label"><fmt:message key='spms'/></label>
                <div class="layui-input-inline" style="width: 70%">
                    <div id="feijin-content" style="width: 100%;">${goods.content}</div>
                </div>
            </div>


            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                <legend><fmt:message key='shxx'/></legend>
            </fieldset>

            <div class="layui-form-item">
                <label class="layui-form-label"><fmt:message key='shjg'/></label>
                <div class="layui-form-mid layui-word-aux">
                    <c:choose>
                        <c:when test="${goods.status eq 2}"><fmt:message key='shz'/></c:when>
                        <c:when test="${goods.status eq 3}"><fmt:message key='shtg'/></c:when>
                        <c:when test="${goods.status eq 4}"><fmt:message key='shbtg'/></c:when>
                    </c:choose>
                </div>
            </div>


            <div class="layui-form-item">
                <label class="layui-form-label"><fmt:message key='shbz'/></label>
                <div class="layui-form-mid layui-word-aux">
                        ${goods.checkNote}
                </div>
            </div>

        </form:form>
    </div>
</div>

<script>

    $(function () {

        layui.use(['form', 'laydate'], function () {

            var form = layui.form;
            var laydate = layui.laydate;

        });

    });
</script>
</body>
</fmt:bundle>
</html>